package com.loren.oauth.data.resp;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
public class ErrorResponse implements Serializable {

    private static final long serialVersionUID = -9076829633174742069L;

    public static final int FAILURE_CODE = 10001;

    public static final int NEED_AUTH_CODE = 10401;

    public static final int ACCESS_DENIED_CODE = 10403;

    public static final int SYSTEM_ERROR_CODE = 99999;

    private Integer code;

    private String message;

    public ErrorResponse(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static ErrorResponse failure(String message) {
        return new ErrorResponse(FAILURE_CODE, message);
    }
}
